<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<link th:href="@{/ajax/libs/jquery-layout/jquery.layout-latest.css}" rel="stylesheet"/>
<link th:href="@{/ajax/libs/jquery-ztree/3.5/css/metro/zTreeStyle.css}" rel="stylesheet"/>
<body>
<div class="ui-layout-east">
    <div class="main-content">
        <div class="box box-main">
            <div class="box-header">
                <div class="box-title">
                    <i class="fa icon-grid"></i> 终端列表
                </div>
                <div class="box-tools pull-right">
                    <button type="button" class="btn btn-box-tool" id="btnExpand" title="展开" style="display:none;">
                        <i class="fa fa-chevron-up"></i></button>
                    <button type="button" class="btn btn-box-tool" id="btnCollapse" title="折叠">
                        <i class="fa fa-chevron-down"></i></button>
                    <button type="button" class="btn btn-box-tool" id="btnRefresh" title="刷新">
                        <i class="fa fa-refresh"></i></button>
                </div>
            </div>
            <div class="ui-layout-content">
                <div id="tree" class="ztree"></div>
            </div>
        </div>
    </div>
</div>
<div class="container-div ui-layout-center">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            终端号：<input type="text" name="phone"/>
                        </li>
                        <li>
                            地区:<input type="text" name="pra"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
        <div class="btn-group-sm hidden-xs" id="toolbar" role="group">
            <a class="btn btn-danger btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="broad:personpush:remove">
                <i class="fa fa-remove"></i> 删除
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true"></table>
            <textarea class="col-xs-7" rows="16" name="content" id="content" wrap="soft" title="内容"></textarea>
            <span id="sms" class="col-xs-4" style="display:none;">
													提示： 短信命令必须为英文<br><br>
													短信命令示例：<br>
													重启：app-server:110.53.162.164:8600<br>
													升级：upgrade-server:110.53.162.164:8600<br>
													调整音量：chan-volume:38,38,38,38<br>
													紧急调频转播：urgent:fm,101.7MHz,300<br>
													紧急节目广播：urgent:mp3,1700011.mp3,600<br>
													获取终端状态：get status<br>
													紧急停止：urgent:stop<br>
												</span>
            <span id="smsbroad" class="col-xs-4">
													提示：短信第一个字必须为汉字。 <br><br>
												</span>
        </div>
    </div>
</div>
<div th:include="include :: footer"></div>
<script th:src="@{/ajax/libs/jquery-layout/jquery.layout-latest.js}"></script>
<script th:src="@{/ajax/libs/jquery-ztree/3.5/js/jquery.ztree.all-3.5.js}"></script>
<script th:inline="javascript">
    var removeFlag = [[${@permission.hasPermi('broad:personpush:remove')}]];
    $(function () {
        $('body').layout({ east__size: 300});
        queryAreaTree();
        // queryInfoList();
    });
    function queryAreaTree()
    {
        var url = ctx + "broad/area/treeData";
        var options = {
            url: url,
            expandLevel: 2,
            onClick : zOnClick
        };
        $.tree.init(options);
        function zOnClick(event, treeId, treeNode) {
            $("#Aid").val(treeNode.id);
            $("#Parentaid").val(treeNode.pId);
            $.table.search();
        }
    }
    $('#btnExpand').click(function() {
        $._tree.expandAll(true);
        $(this).hide();
        $('#btnCollapse').show();
    });

    $('#btnCollapse').click(function() {
        $._tree.expandAll(false);
        $(this).hide();
        $('#btnExpand').show();
    });

    $('#btnRefresh').click(function() {
        queryAreaTree();
    });
</script>
</body>
</html>